<%-- 
    Document   : gestionEmpleados
    Created on : 4/09/2013, 04:45:53 PM
    Author     : Ricardo
--%>
<%@page import="com.session.Session"%>
<%@page session="true" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%    
    //<jsp:forward page="www.google.com"></jsp:forward>
    Session sesion = (Session)session.getAttribute("Sesion");    
    if(sesion==null){ 
    sesion = new Session();
    sesion.setStatus(false);    %>
    
<%        
    }
%>
<div id="verEmpleado"></div>
<div id="tablaEmpleado">
    <h3>Empleados</h3>
    <table border="0" cellpadding="0" cellspacing="0"  id="id-form">
        <tr>
                <th valign="top">Buscar: </th>
                <td><input type="text" class="inp-form" id="buscar" name="buscar" /></td>
                <td><input type="button" value="Buscar" class="btn" id="btnBuscar" name="btnBuscar"/></td>
                <td width="40%" align="right"><input type="button" value="Agregar Empleado" id="btnAgregar" class="btn"></td>
        </tr>
    </table>                
    <table border="0" width="60%" cellpadding="0" cellspacing="0" id="product-table">
        <tr>                
                <th class="table-header-repeat line-left minwidth-1"><a>ID</a>	</th>
                <th class="table-header-repeat line-left minwidth-1" width="50%"><a>Nombre</a>	</th>
                <th class="table-header-repeat line-left minwidth-1"><a>Puesto</a>	</th>
                <th class="table-header-repeat line-left minwidth-1"><a>Ver</a></th>
                <% if(sesion.isStatus()){
                    out.println("<th class='table-header-repeat line-left minwidth-1'><a>Modificar</a></th>");
                    out.println("<th class='table-header-repeat like-left minwidth-1'><a>Eliminar</a></th>");
                    }
                %>                                               
        </tr>
        <s:iterator value="empleados" status="estatus">
            <tr id="<s:property value='idEmpleado'/>">
                <td><s:property value="idEmpleado"/></td>    
                <td><s:property value="nombre"/></td>
                <td><s:property value="puesto"/></td>
                <td><center><input type="button" id="btnVer" value="Ver" class="btn"/></center></td>
                <% if(sesion.isStatus()){
                    out.println("<td><center><input type='button' id='btnModificar' value='Modificar' class='btn'/></center></td>");
                    out.println("<td><center><input type='button' id='btnEliminar' value='Eliminar' class='btn'/></center></td>");
                    }
                %>                                   
            </tr>
        </s:iterator>
    </table>
</div>
